{include file="header.html"}
<script type="text/javascript">
var template_name = '{$curr_template_name}';
var style_name = '{$curr_style_name}';
var type = '{$smarty.get.type}' ? '{$smarty.get.type}' : '';
function use_theme(template, style){
    if (template != template_name)
    {
        if (!confirm('{$lang.set_theme_warning}'))
        {
            return;
        }

    }
    window.location.href = 'index.php?app=theme&act=set&template_name=' + template + '&style_name=' + style+'&type='+type;
}
function preview_theme(template, style,type){
    $('#template_name').val(template);
    $('#style_name').val(style);
	$('#type').val(type);
	
    $('#preview_form').submit();
}
function go_index(){
    $('#go_index').submit();
}
</script>
<style type="text/css">
<!--
body {background: none}
#rightTop p {padding-top: 5px;}
#rightCon { list-style:none; width:100%; }
#rightCon li { float:left; margin:10px; }
#rightCon .title_name { font-size:15px; font-weight:bold; color:#4DA1E0; text-align:center; }
#rightCon .templet_style { margin:5px; background:#eee; border:#ddd 1px solid; padding:3px; text-align: center;}
#rightCon .templet_btn { text-align:center; }
-->
</style>
<div id="rightTop">
<p>
    <!--{if $smarty.get.type eq 'mobile'}-->
    <b>{$lang.mobile_theme}</b>
    <a href="{url app=theme}" class="btn1" style="margin-left:10px;display:inline-block;">{$lang.pc_theme}</a><br />
    {$lang.current_theme}:{$curr_wap_template_name}&nbsp;{$curr_wap_style_name}
    <!--{else}-->
    <b>{$lang.pc_theme}</b>
	<a href="{url app=theme&type=mobile}" class="btn1" style="margin-left:10px;display:inline-block;">{$lang.mobile_theme}</a><br />
    {$lang.current_theme}:{$curr_template_name}&nbsp;{$curr_style_name}
    <!--{/if}-->
</p>

</div>
<ul id="rightCon">
    <!--{foreach from=$theme_list key=template_name item=styles}-->
    <!--{foreach from=$styles item=style_name}-->
    <li>
        <div class="title_name">{$template_name}&nbsp;{$style_name}</div>
        <div class="templet_style"><img src="{$site_url}{if $smarty.get.type eq 'mobile'}/mobile{/if}/themes/mall/{$template_name}/styles/{$style_name}/preview.jpg" onclick="preview_theme('{$template_name}', '{$style_name}','{$smarty.get.type}');" /></div>
        <div class="templet_btn">
        <!--{if $smarty.get.type neq 'mobile'}-->
        <!--{if $curr_template_name neq $template_name or $curr_style_name neq $style_name}-->
        <input type="button" value="{$lang.use}" onclick="use_theme('{$template_name}', '{$style_name}');" class="formbtn" />&nbsp;&nbsp;
        <input type="button" value="{$lang.preview}" onclick="preview_theme('{$template_name}', '{$style_name}');" class="formbtn" />
        <!--{else}-->
        <input type="button" value="{$lang.go_index}" onclick="go_index()" class="formbtn" />
        <!--{/if}--> 
        <!--{else}-->
        <!--{if $curr_wap_template_name neq $template_name or $curr_wap_style_name neq $style_name}-->
        <input type="button" value="{$lang.use}" onclick="use_theme('{$template_name}', '{$style_name}');" class="formbtn" />&nbsp;&nbsp;
        <input type="button" value="{$lang.preview}" onclick="preview_theme('{$template_name}', '{$style_name}','{$smarty.get.type}');" class="formbtn" />
        <!--{else}-->
        <input type="button" value="{$lang.current_wap_theme}"  class="formbtn" />
        <!--{/if}-->
        <a href="{url app=theme&act=config&template=$template_name&style=$style_name&type=$smarty.get.type}" class="formbtn" style="display:inline-block;text-decoration:none;line-height: 21px;
vertical-align: baseline;">{$lang.edit}</a>
        <!--{/if}-->
        </div>
    </li>
    <!--{/foreach}-->
    <!--{/foreach}-->
</ul>
<form id="preview_form" method="POST" action="index.php?app=theme&act=preview" target="_blank"><input type="hidden" name="template_name" id="template_name" /><input type="hidden" name="style_name" id="style_name" /><input type="hidden" name="type" id="type" /></form>

<form id="go_index" method="GET" action="{$site_url}" target="_blank"></form>
{include file="footer.html"}
